/***********************************************************************
    filename:   DaterEventEditWindow.h
    created:    10/4/2012
    author:     4Ys

    purpose:    Defines class for EventEditWindow objects in UI
*************************************************************************/
#ifndef _DaterEventEdit_h_
#define _DaterEventEdit_h_

#include "CEGUI.h"
#include "DaterBaseWindow.h"
#include "DaterEvent.h"

class EventEditWindow : public BaseWindow
{
	/* !
	\brief
		The window of Event Edit.
	*/
public:
		/* !
		\brief
			Construct the sample of class EventEditWindow.

		\param id_name
			- a string to represent the prefix of the window.
			
		\param parent
			- point to parent window.
		*/
	EventEditWindow(const CEGUI::String& id_name, CEGUI::Window* parent = 0);
	
		/* !
			Destructor of class EventEditWindow.
		*/
	virtual ~EventEditWindow();

		/* !
		\brief
			a virtual function generated from class BaseWindow to show window.
		*/
	virtual void showWindow();
	
		/* !
		\brief
			a virtual function generated from class BaseWindow to hide window.
		*/
	virtual void hideWindow();

		/* !
		\brief
			a virtual function to show window with a related Event.
			
		\param relatedGroup
		*/
	void showWindow(Dater::Event* relatedEvent);

	void showWindow(std::string startDay, std::string endDay, std::string startTime = "", std::string finishTime = "");

private:	
		/* !
		\brief
			Handle the process and close the button.
			
		\param args
			- the processing program.
		*/	
	bool handle_CloseButton(const CEGUI::EventArgs& args);

		/* !
		\brief
			Handle the process and submit.
			
		\param args
			- the processing program.
		*/
	bool handle_Submit(const CEGUI::EventArgs& args);

		/* !
		\brief
			Refresh the input window.
		*/
	void refreshInputWindow();

		//! A map contains related group events of a certain group.
	Dater::Event* _relatedEvent;
			
		//! Represent whether the group is changable.
	bool _ableToChange;
};

#endif